package service

import (
    "authserver/global"
    "authserver/model"
)

func AddXyRecord(record model.XyRecord) (err error) {

    err=global.GVA_DB.Create(&record).Error
    return err

}

func GetXyRecordSta() (sta []model.XyRecordStaResp) {

    sta=make([]model.XyRecordStaResp,0)

    global.GVA_DB.Table(model.XyRecord{}.TableName()).
        Select("count(*) log_count,substr(record_time,1,10) record_day").
        Group("record_day").Find(&sta)

    return sta

}
